package com.woniuxy.caradmin.service.impl;

import com.woniuxy.caradmin.entity.pojo.Insurerecord;
import com.woniuxy.caradmin.entity.vo.InsurerecordVo;
import com.woniuxy.caradmin.mapper.InsurerecordMapper;
import com.woniuxy.caradmin.service.InsurerecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author womenzu
 * @since 2020-12-07
 */
@Service
public class InsurerecordServiceImpl implements InsurerecordService {
@Autowired
    private InsurerecordMapper insurerecordMapper;

    @Override
    public List<Insurerecord> selectAllByPage(InsurerecordVo insurerecordVo) {
        return insurerecordMapper.selectAllByPage(insurerecordVo);
    }

    @Override
    public int addInsurerecord(Insurerecord insurerecord) {

        return insurerecordMapper.addInsurerecord(insurerecord);
    }

    @Override
    public int  upInsurerecord(Insurerecord insurerecord) {

        return insurerecordMapper.upInsurerecord(insurerecord);
    }

    @Override
    public boolean removeInsurerecord(Integer []ids) {
        if (ids != null && ids.length > 0 ){
            for (Integer id :ids){
                insurerecordMapper.removeInsurerecord(id);
            }
            return true;
        }
        return false;
    }

    @Override
    public Insurerecord selectInsureById(Integer id) {
        return insurerecordMapper.selectInsureById(id);
    }
}
